package com.anda.logistics.model;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

@Entity
public class DriverLocationRt {
	private String number;
	private double lng;
	private double lat;	
	private long id;
	private Date upTime;
	private Date getTime;
	private int type;
	private float accuracy ;
	private String accessToken;
	private String country;
	private String countryCode;
	private String region;
	private String city;
	private String street;
	private String streetNumber;
	private String subLocality;
	private String featureName;
	private String thoroughfare;
	private String subAdminArea;
	private String addressDetail;
	private String cityCode;
	private String locationDesc;
	
	public DriverLocationRt(){}
	public DriverLocationRt(String number, double lng, double lat) {
		super();
		this.number = number;
		this.lng = lng;
		this.lat = lat;
	}
	
	@Override
	public String toString() {
		return "DriverLocationRt [number=" + number + ", lng=" + lng + ", lat="
				+ lat + ", id=" + id + ", upTime=" + upTime + ", getTime="
				+ getTime + ", type=" + type + ", accuracy=" + accuracy
				+ ", accessToken=" + accessToken + ", country=" + country
				+ ", countryCode=" + countryCode + ", region=" + region
				+ ", city=" + city + ", street=" + street + ", streetNumber="
				+ streetNumber + "]";
	}
	
	@Column(length=20)
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public double getLng() {
		return lng;
	}
	public void setLng(double lng) {
		this.lng = lng;
	}
	public double getLat() {
		return lat;
	}
	public void setLat(double lat) {
		this.lat = lat;
	}
	@Id	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}

	public Date getUpTime() {
		return upTime;
	}

	public void setUpTime(Date upTime) {
		this.upTime = upTime;
	}
	@Transient
	public String getFormatUpTime(){
		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(upTime);
	}
	public Date getGetTime() {
		return getTime;
	}

	public void setGetTime(Date getTime) {
		this.getTime = getTime;
	}
	
	@Transient
	public String getFormatGetTime(){
		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(getTime);
	}
	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	public float getAccuracy() {
		return accuracy;
	}
	public void setAccuracy(float accuracy) {
		this.accuracy = accuracy;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getAccessToken() {
		return accessToken;
	}
	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	@Column(columnDefinition="VARCHAR(20)")
	public String getCountryCode() {
		return countryCode;
	}
	public void setCountryCode(String countryCode) {
		this.countryCode = countryCode;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getStreetNumber() {
		return streetNumber;
	}
	public void setStreetNumber(String streetNumber) {
		this.streetNumber = streetNumber;
	}
	
	@Column(columnDefinition="VARCHAR(100)")
	public String getSubLocality() {
		return subLocality;
	}
	public void setSubLocality(String subLocality) {
		this.subLocality = subLocality;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getFeatureName() {
		return featureName;
	}
	public void setFeatureName(String featureName) {
		this.featureName = featureName;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getThoroughfare() {
		return thoroughfare;
	}
	public void setThoroughfare(String thoroughfare) {
		this.thoroughfare = thoroughfare;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getSubAdminArea() {
		return subAdminArea;
	}
	public void setSubAdminArea(String subAdminArea) {
		this.subAdminArea = subAdminArea;
	}
	@Column(columnDefinition="VARCHAR(400)")
	public String getAddressDetail() {
		return addressDetail;
	}
	public void setAddressDetail(String addressDetail) {
		this.addressDetail = addressDetail;
	}
	@Column(columnDefinition="VARCHAR(20)")
	public String getCityCode() {
		return cityCode;
	}
	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}
	@Column(columnDefinition="VARCHAR(100)")
	public String getLocationDesc() {
		return locationDesc;
	}
	public void setLocationDesc(String locationDesc) {
		this.locationDesc = locationDesc;
	}
}
